package com.xmutca.core.common;

/**
 * 重定向返回
 * @author: 彭伟煌(pengweihuang@xmutca.com)
 * @create: 2016-07-08 23:30
 */
public class Redirect extends Result<Object> {

    private String url;

    public Redirect() {
        setStatus(Status.REDIRECT);
    }

    public Redirect(String url) {
        this.url = url;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public static class Builder {

        private String message;

        private String url;

        public Builder setMessage(String message) {
            this.message = message;
            return this;
        }

        public Builder setUrl(String url) {
            this.url = url;
            return this;
        }

        public Redirect build() {
            Redirect redirect = new Redirect();
            redirect.setMessage(this.message);
            redirect.setUrl(this.url);
            return redirect;
        }
    }
}
